A magnetometer is an instrument used to measure the strength and/or direction of the magnetic field in the vicinity of the instrument. Many electronic devices exist that utilize a magnetometer for taking measurements for a particular application, e.g. metal detectors, geophysical instruments, aerospace equipment, and mobile communications devices such as cellular telephones, PDAs, smart phones, tablet computers, etc., to name a few. For example, devices that comprise a magnetometer and have a display and processing capabilities, e.g., a smart phone, may include a compass application for showing a direction on the display.
Mobile communication devices, such as those listed above, typically operate in various different locations and under various circumstances. Changes in the environment in which the device operates can affect the operation of the magnetometer. Furthermore, magnetic interference moving with the mobile communication device and/or from components of the mobile communication device itself, such as components with hard iron, may affect the operation of the magnetometer. As such, the magnetometer may need to be calibrated at certain times.